from django.conf.urls.defaults import patterns, include, url
import os
from settings import PROJECT_PATH

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

from settings import URL_PATH
if URL_PATH:
  PREFIX = '%s/' % URL_PATH[1:]
else:
  PREFIX = ''

urlpatterns = patterns('',
    # Examples:
    # url(r'^$', 'hoca.views.home', name='home'),
    # url(r'^hoca/', include('hoca.foo.urls')),

    # Uncomment the admin/doc line below to enable admin documentation:
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    url(r'^%sadmin/' % PREFIX, include(admin.site.urls)),
    url(r'^%ssite_media/(?P<path>.*)$' % PREFIX, 'django.views.static.serve', {'document_root': os.path.join(PROJECT_PATH, 'site_media')}),


    #url(r'^lessonplan$' % PREFIX, 'drill.views.lessonplan'),
    #url(r'^tutorial$', 'drill.views.tutorial'),
    #url(r'^drill$', 'drill.views.drill'),
    #url(r'^drill2$', 'drill.views.drill2'),
    #url(r'^drill3$', 'drill.views.drill3'),
    #url(r'^text$', 'drill.views.text'),
    #url(r'download', 'drill.views.download'),

    url(r'%sjson_evaluate_answer1/$'  % PREFIX, 'drill.views.json_evaluate_answer1'),
    url(r'%sjson_get_question1/$' % PREFIX, 'drill.views.json_get_question1'),
    url(r'%sjson_get_question_simple/$' % PREFIX, 'drill.views.json_get_question_simple'),

    url(r'^%s$' % PREFIX, 'drill.views.welcome'),

    url(r'^%s(?P<lesson_sname>.*)/drill/(?P<drill_sname>.*)/$' % PREFIX, 'drill.views.foo'),
    url(r'^%s(?P<lesson_sname>.*)/document/(?P<drill_sname>.*)/$' % PREFIX, 'drill.views.show_document'),
    url(r'^%s(?P<lesson_sname>.*)/drill_list/$' % PREFIX, 'drill.views.drill_list'),
    url(r'^%s(?P<lesson_sname>.*)/$' % PREFIX, 'drill.views.show_document', {'drill_sname':'lesson_plan'}),
  
    url(r'^%s(?P<lesson_sname>.*)/json_get_question2/(?P<drill_sname>.*)/$' % PREFIX, 'drill.views.json_get_question2'),
    url(r'^%sjson_evaluate_answer2/$' % PREFIX, 'drill.views.json_evaluate_answer2'),


    #url(r'^(?P<lesson_sname>.*)/details/$', 'drill.views.details'),
)
